/*Testing logging*/
truncate table metadata.logging;
truncate table metadata.loggingValues;
GO
SET STATISTICS IO OFF;
GO
declare @set_id uniqueidentifier ;
set @set_id=NEWID();

execute  metadata.logInsert
@set_id=@set_id
,@calling_sql_name='__Work3.sql'
,@step=1
,@total_steps=3
,@message='Test Message 1'

execute  metadata.logValueInsert
@set_id=@set_id
,@name='User_type'
,@value='1'

execute  metadata.logInsert
@set_id=@set_id
,@calling_sql_name='__Work3.sql'
,@step=2
,@total_steps=3
,@message='Test Message 2'
,@user_type=2

execute  metadata.logValueInsert
@set_id=@set_id
,@name='User_type'
,@value='2'

execute  metadata.logInsert
@set_id=@set_id
,@calling_sql_name='__Work3.sql'
,@step=3
,@total_steps=3
,@message='Test Message 3'
,@user_type=3

execute  metadata.logValueInsert
@set_id=@set_id
,@name='User_type'
,@value='3'

/*New set*/
set @set_id=NEWID();
execute  metadata.logInsert
@set_id=@set_id
,@calling_sql_name='__Work3A.sql'
,@step=1
,@total_steps=2
,@message='Uncomplete Run!'

select * from metadata.logging;
select * from metadata.loggingValues;
select * from metadata.logStatus;